/*
 * PlaneControl.h
 *
 *  Created on: 2012/07/12
 *      Author: weihe
 */

#ifndef PLANECONTROL_H_
#define PLANECONTROL_H_

#include <ctime>
#include "glex.h"
#include "Drawable.h"
#include "DrawList.h"
#include "Text.h"
#include "AirPlane.h"
#include "Aiming.h"

namespace object {

class PlaneControl: public object::Drawable {

	Rectangle window;
	bool gameOver;
	AirPlane *plane;
	Text *scoreTxt;
	Text *timeTxt;
	Text *fpsTxt;
	Aiming *aiming;
public:
	int score;
	time_t deadTime;
	PlaneControl(Camera *camera, AirPlane *plane) :
			Drawable(camera), gameOver(false), plane(plane), score(0), deadTime(
					0)
	{
		window.height = 100;
		window.width = window.height * camera->film.aspect;
		scoreTxt = new Text(window.width - 20, 10, GLUT_BITMAP_HELVETICA_12);
		timeTxt = new Text(5, 10, GLUT_BITMAP_HELVETICA_12);
		fpsTxt = new Text(5, 5, GLUT_BITMAP_HELVETICA_12);
		aiming = new Aiming(camera, window);
	}
	virtual ~PlaneControl();
	virtual bool update(float dt);
	virtual void draw();
};

} /* namespace object */
#endif /* PLANECONTROL_H_ */
